package uk.ac.durham.tel.synergynet.ats;

import org.eclipse.ui.IPageLayout;
import org.eclipse.ui.IPerspectiveFactory;
import org.eclipse.ui.IPlaceholderFolderLayout;

import uk.ac.durham.tel.synergynet.ats.annotations.ui.views.AnnotationPropertyViewPart;
import uk.ac.durham.tel.synergynet.ats.annotations.ui.views.AnnotationTableViewPart;
import uk.ac.durham.tel.synergynet.ats.attributes.ui.views.CodingExplorerViewPart;
import uk.ac.durham.tel.synergynet.ats.projects.ui.ProjectExplorerViewPart;

public class Perspective implements IPerspectiveFactory {

	public void createInitialLayout(IPageLayout layout) {
		String editorArea = layout.getEditorArea();
		layout.getViewLayout(ProjectExplorerViewPart.ID).setCloseable(false);
		//layout.getViewLayout(AnnotationPropertyViewPart.ID).setCloseable(false);
		layout.addView(ProjectExplorerViewPart.ID, IPageLayout.LEFT, 0.25f, editorArea);
		layout.addView(CodingExplorerViewPart.ID,IPageLayout.BOTTOM, 0.25f, ProjectExplorerViewPart.ID);
		layout.addPlaceholder(AnnotationTableViewPart.ID,IPageLayout.BOTTOM, 0.7f, editorArea);
		IPlaceholderFolderLayout folder = layout.createPlaceholderFolder("Annoataions", IPageLayout.BOTTOM, 0.5f, CodingExplorerViewPart.ID);
		folder.addPlaceholder(AnnotationPropertyViewPart.ID);
		folder.addPlaceholder("org.eclipse.pde.runtime.LogView");
	}
}
